import React, { Component } from 'react';
import { Card } from 'antd';
import { isArray, isEmpty, isObject, map, omit } from 'lodash';
import DataTable from '../DataTable';
import PageHeaderComp from '/common/componentsTpl/PageHeaderComp';

export default class BusinessDataGrid extends Component {
  render() {
    const { compSetting } = this.props;
    // 页面头部
    const { header } = compSetting;
    let pageHeader;
    if (!isEmpty(header) && isObject(header)) {
      pageHeader = <PageHeaderComp compSetting={header}/>;
    }

    return (
      <div className="main-wrapper">
        {pageHeader}
        <Card className='main-body' bodyStyle={{ padding: 16 }}>
          <DataTable compSetting={omit(compSetting, ['header'])}/>
        </Card>
      </div>
    );
  }
}
